//
//  SC_Table_Cell.swift
//  APSwift
//
//  Created by jianbo.pei on 2023/4/5.
//

import UIKit

class SC_Table_Cell: APBaseTableViewCell {
    
    private var titleLabel: UILabel!

    override func initUI() {
        super.initUI()
        contentView.backgroundColor = .white
        
        titleLabel = UILabel().then({ make in
            contentView.addSubview(make)
            make.font = .systemFont(ofSize: 20)
        })
    }
    
    override func makeConstraints() {
        super.makeConstraints()
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(16)
            make.centerY.equalToSuperview()
        }
    }
    
    override func setup(_ model: Any?) {
        super.setup(model)
        guard let m = model as? SC_Table_Model else { return }
        titleLabel.text = m.title
    }
    
}

extension SC_Table_Cell: APView_Height_Protocol {
    static func viewHeight(with model: Any?) -> CGFloat {
        return 80
    }
}
